<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>
<link rel="stylesheet" type="text/css" href="css/public.css" />
<link rel="stylesheet" type="text/css" href="css/page.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/public.js"></script>
<script type="text/javascript">
	function l(){
		window.location.href="http://localhost:8080/userRegister";
	} 
	var ws; //一个ws对象就是一个通信管道！！
	var target ="ws://localhost:8080/websocket";
	function subOpen(){
		 if ('WebSocket' in window) {
             ws = new WebSocket(target);
         } else if ('MozWebSocket' in window) {
             ws = new MozWebSocket(target);
         } else {
             alert('WebSocket is not supported by this browser.');
             return;
         }
		 
		 ws.onmessage = function(event){
			var dv=document.getElementById("dv");
			dv.innerHTML += event.data;	
		};
	}
</script>
</head>
<body>
	<form action="#" th:action="@{/validate}" th:object="${user}" method="post">
	<!-- 登录body -->
	<div class="logDiv">
		<img class="logBanner" src="img/logBanner.png" />
		<div class="logGet">
			<!-- 头部提示信息 -->
			<div class="logD logDtip">
				<p class="p1">登录</p>
			</div>
			<!-- 输入框 -->
			<div class="lgD">
				<img class="img1" src="img/logName.png" /><input type="text" name="username" placeholder="输入用户名" />
			</div>
			<div class="lgD">
				<img class="img1" src="img/logPwd.png" /><input type="password" name="password" placeholder="输入用户密码"  />
			</div>
			<input style="width: 100%;height: 45px;background-color: #ee7700;border: none;color: white;font-size: 18px;" 
			type="submit" onclick="subOpen();" value="登录" />
			
			<div style="height:10px;" ></div>
		<!-- 	<div class="logC2" id="registerUser">
				<button onclick="l()">注册</button>
			</div> -->
			
		</div>
	</div>
	<!-- 登录body  end -->
	</form>
	<div style="position:relative;width: 100px;height: 30px;margin-top:50px;margin-left:auto;margin-right:auto;  background-color: #0772A1;border: none;color: white;font-size: 18px;" > <!-- <a th:href="@{/useradd}" ></a> -->
			<button onclick="l()"style="z-index:999;width: 100%;height: 45px;background-color: #0772A1;border: none;color: white;font-size: 18px;" >注册</button>
	</div>

	<!-- 登录页面底部end -->
   
</body>
</html>